package myNewProject.downloader;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

public class JsoupDownloader implements Downloader {

    @Override
    public StringBuilder getSourceCode(String link){
        StringBuilder result;
        Document doc = null;
        try {
            doc = Jsoup.connect(link).get();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        result = new StringBuilder(doc.html());
        return result;
    }
}

